package com.example.okhttputils.mvp.presenter;

import com.example.okhttputils.mvp.base.BaseModel;
import com.example.okhttputils.mvp.base.BaseObserver;
import com.example.okhttputils.mvp.base.BasePresenter;
import com.example.okhttputils.mvp.ui.view.ArtListView;

import java.util.Map;

public class ArtListPresenter extends BasePresenter<ArtListView> {
    public ArtListPresenter(ArtListView baseView) {
        super(baseView);
    }

    /**
     * 获取短信验证码
     * @param map
     */
    public void getArtList(Map<String, String> map){
        addDisposable(apiServer.getArtList(map), new BaseObserver<BaseModel>(baseView) {
            @Override
            public void onSuccess(BaseModel o) {
                baseView.onArtList(o);
            }

            @Override
            public void onError(String msg) {
                baseView.showError(msg);
            }
        });
    }
}
